//
//  RXButton.m
//  meituan
//
//  Created by huiwenjiaoyu on 15/12/17.
//  Copyright © 2015年 Rick. All rights reserved.
//

#import "RXButton.h"
#import "UIImage+AFNetworking.h"

@implementation RXButton

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createContents];
    }
    return self;
}

- (void)createContents
{
    CGFloat centerX = self.frame.size.width * 0.5;
    CGFloat centerY = self.frame.size.height * 0.7;

    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, centerY, centerY)];
    self.imageView.center = CGPointMake(centerX, centerY * 0.5 + 3);
    [self addSubview:self.imageView];
    
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.imageView.frame), self.frame.size.width, centerY * 0.4)];
    self.label.textAlignment = NSTextAlignmentCenter;
    self.label.font = [UIFont systemFontOfSize:12];
    self.label.backgroundColor = [UIColor clearColor];
    self.label.textColor = [UIColor blackColor];
    [self addSubview:self.label];
}

@end
